package com.jay.cloudstudy.ui.home

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class HomeViewModel : ViewModel() {

    private val _text = MutableLiveData<String>().apply {
        value = "This is home Fragment"
    }
    val text: MutableLiveData<String> = _text
    val bannerList: MutableLiveData<List<HomeBannerBean>> =
        MutableLiveData<List<HomeBannerBean>>().apply {
            value = ArrayList()
        }

    fun updateBanners() {
        var list = ArrayList<HomeBannerBean>()
        list.add(HomeBannerBean("https://dss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/logo_white-d0c9fe2af5.png"))
        list.add(HomeBannerBean("https://img-blog.csdnimg.cn/2020011009415480.png"))
        bannerList.postValue(list)
    }
}